home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Network Supervisor's Toolkit
/
Network Supervisor's Toolkit.iso
/
tools
/
lu62
/
debug
/
rem_getf.c
< prev
next >
Wrap
C/C++ Source or Header
|
1996-07-10
|
4KB
|
122 lines
/*
* CopyRight 1995. Nicholas Poljakov all rights reserved.
*/
/************************* REM_GETF.C ***************************/
/* get file name for remote LU */
/******************************************************************/
#include <dos.h>
#include <stdio.h>
#include <string.h>
#include <io.h>
#include <fcntl.h>
#include <stdlib.h>
#include <state1.h>
extern int sw;
extern char lu_id[8];
extern char tp_id[8];
extern char tp_exist;
extern unsigned long conv_id;
extern struct part { /* partner structure */
char plu[8] ; /* str plu_name */
int psl; /* str plu_s_limit */
char mode_name[8] ; /* str mode_name */
int max_ru_size; /* str ru_h_size */
int pacing; /* str = */
unsigned char lu_type;
} pstr[4];
rem_getf(s_dta,from)
int from;
struct dt {
char reserv[21];
char attr;
unsigned int time;
unsigned int date;
unsigned long int size;
char name[18];
} *s_dta;
{
unsigned char rts;
unsigned char wr;
unsigned int max_length ;
unsigned char tpn[64];
struct rc {
unsigned int prim;
unsigned long sec;
} v_rc;
struct msg { /*send_data*/
int len;
char str[sizeof(struct dt)];
} gds;
unsigned long rc;
char p_lu[9];
char p_mode[9];
int length;
if (sw == 0) {
if (!tp_exist) {
tp_started
(lu_id,
tp_id,
&rc);
if (rc != 0) {
return -1;
}
tp_exist = 1; /* TP_started O.K! */
}
strcpy (tpn,"DIR "); /* name of work */
strcat (tpn, "get"); /* name of sub-funct */
/*conv_id - return param -id work link */
strcpy(p_lu, pstr[from - 1].plu);
strcpy(p_mode, pstr[from - 1].mode_name);
allocate (p_lu,
p_mode,
tpn,
WHEN_SESSION_ALLOCATED,
NONE,
NONE,
NULL,
NULL,
tp_id,
&conv_id,
NULL,
&v_rc) ;
if (v_rc.prim != 0) {
return (-1);
}
sw++;
} /* sw == 0 */
max_length = 2017;
recwait (tp_id,
conv_id,
ll,
&v_rc,
&length,
max_length,
&rts,
&gds,
&wr);
if (v_rc.prim != 0) {
return -1;
}
memcpy (s_dta,gds.str,sizeof(struct dt));
recwait (tp_id,
conv_id,
ll,
&v_rc,
&length,
max_length,
&rts,
&gds,
&wr);
if (v_rc.prim != 0) {
return -1;
}
return 0;
}